package com.hnkywl.sts.service.xsgl;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.hnkywl.sts.dao.base.SjzdzDao;
import com.hnkywl.sts.dao.cggl.NbcgdDao;
import com.hnkywl.sts.dao.htgl.XshtDao;
import com.hnkywl.sts.dao.organ.NbgsDao;
import com.hnkywl.sts.dao.xsgl.KhDao;
import com.hnkywl.sts.dao.xsgl.NbxsdDao;
import com.hnkywl.sts.dao.xsgl.XsdDao;
import com.hnkywl.sts.dao.zjfp.ZjfpmxDao;
import com.hnkywl.sts.entity.base.Sjzdz;
import com.hnkywl.sts.entity.cggl.Cgd;
import com.hnkywl.sts.entity.cggl.Cgdmx;
import com.hnkywl.sts.entity.cggl.Glfy;
import com.hnkywl.sts.entity.organ.Nbbm;
import com.hnkywl.sts.entity.organ.Nbgs;
import com.hnkywl.sts.entity.organ.Qyjg;
import com.hnkywl.sts.entity.xsgl.Kh;
import com.hnkywl.sts.entity.xsgl.Psd;
import com.hnkywl.sts.entity.xsgl.Xsd;
import com.hnkywl.sts.entity.xsgl.Xsmx;
import com.hnkywl.sts.entity.zjfb.Zjfpmx;
import com.hnkywl.sts.service.base.BmService;
import com.hnkywl.sts.service.sys.YgService;
import com.hnkywl.sts.util.CalcUtils;
import net.ruixin.orm.hibernate.Page;
import org.apache.commons.beanutils.PropertyUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.lang.reflect.InvocationTargetException;
import java.sql.SQLException;
import java.text.ParseException;
import java.util.*;

/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 13-7-6
 * Time: 下午4:33
 * To change this template use File | Settings | File Templates.
 */

@Service
public class NbxsdService {
    private NbxsdDao nbxsdDao;
    private NbcgdDao nbcgdDao;
    private NbgsDao nbgsDao;
    private KhDao khDao;

    private BmService bmService;

    private SjzdzDao sjzdzDao;

    // 资金分配明细
    private ZjfpmxDao zjfpmxDao;

    public String findAllXsd(String xsdh, Date fhsjStart, Date fhsjEnd, Long xshtId, Long khId, Long khbmId, Long gcId, Long xsgsId, Long xsbmId, Long xsrId, String zt, String sftzd, int pageNo, int pageSize) throws ParseException {
        Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd").create();
        Page xsdPage = this.nbxsdDao.findXsdList(xsdh, fhsjStart, fhsjEnd, xshtId, khId, khbmId,gcId, xsgsId, xsbmId, xsrId, zt, sftzd, pageNo, pageSize);
        String xsdJson = gson.toJson(xsdPage.getResult());
        return "{\"total\":" + xsdPage.getTotalCount() + ",\"rows\":" + xsdJson + "}";
    }

    @Transactional
    public String findXsdSearch(String xsdh, Date fhsjStart, Date fhsjEnd, Long xsjsdId, Long xsgsId, Long khId, int pageNo, int pageSize) {
        Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd").create();
        Page xsdPage = this.nbxsdDao.findXsdSearch(xsdh, fhsjStart, fhsjEnd, xsjsdId, xsgsId, khId, pageNo, pageSize);
        String xsdJson = gson.toJson(xsdPage.getResult());
        return "{\"total\":" + xsdPage.getTotalCount() + ",\"rows\":" + xsdJson + "}";
    }

    @Transactional
    public String findAllXsdNotFyzr(String psdh, int pageNo, int pageSize) {
        Sjzdz fyzr = sjzdzDao.getSjzdzByBz("配送");
        Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd").create();
        Page xsdPage = this.nbxsdDao.findXsdXspsList(psdh, fyzr, pageNo, pageSize);
        String xsdJson = gson.toJson(xsdPage.getResult());
        return "{\"total\":" + xsdPage.getTotalCount() + ",\"rows\":" + xsdJson + "}";
    }

    @Transactional
    public String findXsdmxSearch(Long xsjsdId) {
        Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd").create();
//        String result = "";
//        Double sbsl = 0d;
//        Double hsj = 0d;
//        Double bhsj = 0d;
//        Double je = 0d;
//        Double se = 0d;
        List<Map> xsdmxList = this.nbxsdDao.findXsdmxSearch(xsjsdId);
//        if (xsdmxList.size() > 0) {
//            for (Map map : xsdmxList) {
//                sbsl += map.get("sbsl") == null ? 0d : Double.parseDouble(map.get("sbsl").toString());
//                hsj += map.get("hsj") == null ? 0d : Double.parseDouble(map.get("hsj").toString());
//                bhsj += map.get("bhsj") == null ? 0d : Double.parseDouble(map.get("bhsj").toString());
//                je += map.get("je") == null ? 0d : Double.parseDouble(map.get("je").toString());
//                se += map.get("se") == null ? 0d : Double.parseDouble(map.get("se").toString());
//            }
//            result = "{\"rows\":" + gson.toJson(xsdmxList) + ",\"footer\":[{\"wzgg.ggxh\":\"合计:\",\"sbsl\":" + sbsl
//                    + ",\"hsj\":" + hsj + ", \"je\":" + je + ",\"se\":" + se + ", \"bhsj\":" + bhsj + "}]}";
//        } else {
//            result = "{\"rows\":" + gson.toJson(xsdmxList) + "}";
//        }
        return gson.toJson(xsdmxList);
    }

    /**
     * 查询销售单
     *
     * @param xsdId 销售单ID
     * @return
     */
    public Xsd findXsdDetail(Long xsdId) {
        return this.nbxsdDao.get(xsdId);
    }

    /**
     * 查询销售单明细
     *
     * @param xsdId 销售单ID
     * @return
     */
    public String findXsmxDetail(Long xsdId) {
        Gson gson = new Gson();
        List<Map> xsdmxList = this.nbxsdDao.findXsmxList(xsdId);
        Integer js = 0;
        Double xscb = 0d;
        Double sbsl = 0d;
        Double hsj = 0d;
        Double bhsj = 0d;
        Double bhse = 0d;
        Double hse = 0d;
        String result = "";
        if (xsdmxList.size() > 0) {
            for (Map map : xsdmxList) {
                js += map.get("js") == null ? 0 : Integer.parseInt(map.get("js").toString());
                xscb += map.get("xscb") == null ? 0d : Double.parseDouble(map.get("xscb").toString());
                sbsl += map.get("sbsl") == null ? 0d : Double.parseDouble(map.get("sbsl").toString());
                hsj += map.get("hsj") == null ? 0d : Double.parseDouble(map.get("hsj").toString());
                hse += (map.get("hsj") == null ? 0d : Double.parseDouble(map.get("hsj").toString())) * (map.get("sbsl") == null ? 0d : Double.parseDouble(map.get("sbsl").toString()));
                bhsj += map.get("bhsj") == null ? 0d : Double.parseDouble(map.get("bhsj").toString());
                bhse += (map.get("bhsj") == null ? 0d : Double.parseDouble(map.get("bhsj").toString())) * (map.get("sbsl") == null ? 0d : Double.parseDouble(map.get("sbsl").toString()));
            }
            result = "{\"rows\":" + gson.toJson(xsdmxList) + ",\"footer\":[{\"kh.khbm\":\"合计:\",\"js\":" + js
                    + ",\"xscb\":" + xscb + ",\"sbsl\":" + sbsl + ",\"hsj\":" + hsj + ",\"bhsj\":" + bhsj + ",\"hse\":" + hse + ",\"bhse\":" + bhse + "}]}";
        } else {
            result = "{\"rows\":" + gson.toJson(xsdmxList) + "}]}";
        }
        return result;
    }

    /**
     * 查询销售单明细(结算)
     *
     * @param xsdId 销售单ID
     * @return
     */
    public String findXsmxJsDetail(Long xsdId) {
        Gson gson = new Gson();
        List<Map> xsdmxList = this.nbxsdDao.findXsmxJsList(xsdId);
        Integer js = 0;
        Double xscb = 0d;
        Double sbsl = 0d;
        Double hsj = 0d;
        Double bhsj = 0d;
        Double bhse = 0d;
        Double hse = 0d;
        String result = "";
        if (xsdmxList.size() > 0) {
            for (Map map : xsdmxList) {
                js += map.get("js") == null ? 0 : Integer.parseInt(map.get("js").toString());
                xscb += map.get("xscb") == null ? 0d : Double.parseDouble(map.get("xscb").toString());
                sbsl += map.get("sbsl") == null ? 0d : Double.parseDouble(map.get("sbsl").toString());
                hsj += map.get("hsj") == null ? 0d : Double.parseDouble(map.get("hsj").toString());
                hse += (map.get("hsj") == null ? 0d : Double.parseDouble(map.get("hsj").toString())) * (map.get("sbsl") == null ? 0d : Double.parseDouble(map.get("sbsl").toString()));
                bhsj += map.get("bhsj") == null ? 0d : Double.parseDouble(map.get("bhsj").toString());
                bhse += (map.get("bhsj") == null ? 0d : Double.parseDouble(map.get("bhsj").toString())) * (map.get("sbsl") == null ? 0d : Double.parseDouble(map.get("sbsl").toString()));
            }
            result = "{\"rows\":" + gson.toJson(xsdmxList) + ",\"footer\":[{\"kh.khbm\":\"合计:\",\"js\":" + js
                    + ",\"xscb\":" + xscb + ",\"sbsl\":" + sbsl + ",\"hsj\":" + hsj + ",\"bhsj\":" + bhsj + ",\"hse\":" + hse + ",\"bhse\":" + bhse + "}]}";
        } else {
            result = "{\"rows\":" + gson.toJson(xsdmxList) + "}]}";
        }
        return result;
    }


    /**
     * 查询销售单明细
     *
     * @param kh 卡号
     * @return
     */
    public List<Map> findXsmxByKh(Kh kh) {
        return this.nbxsdDao.findXsmxByKh(kh);
    }

    /**
     * 查询销售单费用
     *
     * @param xsdId 销售单ID
     * @return
     */
    public String findXsfyDetail(Long xsdId) {
        Gson gson = new Gson();
        String result = "";
        Double jfsl = 0d;
        Double je = 0d;
        List<Map> xsdfyList = this.nbxsdDao.findXsfyList(xsdId);
        if (xsdfyList.size() > 0) {
            for (Map map : xsdfyList) {
                jfsl += map.get("jfsl") == null ? 0d : Double.parseDouble(map.get("jfsl").toString());
                je += map.get("je") == null ? 0d : Double.parseDouble(map.get("je").toString());
            }
            result = "{\"rows\":" + gson.toJson(xsdfyList) + ",\"footer\":[{\"fylb.fykmjc\":\"合计:\",\"jfsl\":" + jfsl
                    + ",\"je\":" + je + "}]}";
        } else {
            result = "{\"rows\":" + gson.toJson(xsdfyList) + "}";
        }
        return result;
    }

    /**
     * 保存销售单
     *
     * @param xsd 销售单
     * @return
     */
    @Transactional
    public void saveXsd(Xsd xsd) throws SQLException {
        xsd.setXsdh(bmService.getXsdbm("nbxs"));
        if (xsd.getSl() != null) {
            java.text.DecimalFormat df = new java.text.DecimalFormat("#0.0000");
            String sl = df.format(xsd.getSl());
            xsd.setSl(Double.parseDouble(sl));
        }
        xsd.setZt("ybc");
        xsd.setXslx("nbxs");
        xsd.setCreateOrgan(YgService.getCurrentYg().getZggs());
        xsd.setCreateDepartment(YgService.getCurrentYg().getZgjg());
        xsd.setCreateUser(YgService.getCurrentYg());
        xsd.setLastUpdated(xsd.getDateCreated());
        if (xsd.getXsmxList() != null) {
            for (Xsmx xsmx : xsd.getXsmxList()) {
                Kh kh = khDao.get(xsmx.getKh().getId());
                xsmx.setJtwz(kh.getJtwz());
                xsmx.setLastUpdated(xsmx.getDateCreated());
            }
        }
        this.nbxsdDao.save(xsd);
        //生成申报公司对采购公司的采购单
        this.nbcgdDao.save(createNbcgd(xsd));
    }

    private Cgd createNbcgd(Xsd xsd) {
        Cgd cgdnb = new Cgd();
        cgdnb.setCgdh(bmService.getCgdbm("nbcg"));
        cgdnb.setDateCreated(new Date());
        cgdnb.setLastUpdated(cgdnb.getDateCreated());
        cgdnb.setZt("ybc");
        cgdnb.setCreateUser(xsd.getCreateUser());
        cgdnb.setYrk(false);
//        cgdnb.setRksj(new Date());
//        cgdnb.setRkr(YgService.getCurrentYg());
        cgdnb.setBz("生成内部采购单");

        Nbgs nbgs=this.nbgsDao.get(xsd.getKh().getId());
        cgdnb.setCggs(nbgs);
        cgdnb.setSbgs(nbgs);
        cgdnb.setSbbm(xsd.getKhbm());
        cgdnb.setSbr(null);
        cgdnb.setCglx("nbcg");
        cgdnb.setCgsj(xsd.getSxsj());
        cgdnb.setCyh(null);
        cgdnb.setDsyfje(xsd.getDsyfje());
//        cgdnb.setDzck(xsd.getThck());
        cgdnb.setFhgs(null);
        cgdnb.setFhrq(xsd.getFhsj());
        cgdnb.setGlId(xsd.getId());
        cgdnb.setGys(xsd.getXsgs());
        cgdnb.setJhdhrq(xsd.getJhsj());
        cgdnb.setSfnb(true);
        cgdnb.setSl(xsd.getSl().toString());
        cgdnb.setSfys(false);
//        cgdnb.setYsrq(new Date());
//        cgdnb.setYsr(YgService.getCurrentYg());
        cgdnb.setCgdmxList(createCgdmxByNbcgd(cgdnb, xsd));
        cgdnb.setCreateOrgan(YgService.getCurrentYg().getZggs());
        cgdnb.setCreateDepartment(YgService.getCurrentYg().getZgjg());
        return cgdnb;
    }

    private List<Cgdmx> createCgdmxByNbcgd(Cgd cgdnb, Xsd xsd) {
        List<Cgdmx> cgdmxes = new ArrayList<Cgdmx>();
        for (Xsmx xsmx  : xsd.getXsmxList()) {
            Cgdmx mx = new Cgdmx();
            mx.setId(null);
            mx.setGg(xsmx.getJtwz());
            mx.setCd(xsmx.getKh().getCd());
            mx.setJs(xsmx.getJs());
            mx.setJzfs(xsmx.getJzfs());
            mx.setSbsl(xsmx.getSbsl());
//            mx.setRksl(xsmx.getSbsl());
//            mx.setRkjs(xsmx.getJs());
            mx.setRkjz(null);
            mx.setBz(xsmx.getBz());
//            mx.setKh(xsmx.getKh());
            mx.setBhsj(xsmx.getBhsj());
            mx.setHsj(xsmx.getHsj());
            mx.setCgd(cgdnb);
            mx.setLastUpdated(new Date());
            cgdmxes.add(mx);
        }
        return cgdmxes;
    }

    public String xsdBm(Xsd xsd) {
        return this.bmService.getXsdbm(xsd.getXslx());
    }

    /**
     * 修改销售单信息
     *
     * @param xsd 销售单
     * @return
     */
    @Transactional
    public void editXsd(Xsd xsd, String xsdbm) {
        xsd.setXsdh(xsdbm);
        if (xsd.getSl() != null) {
            java.text.DecimalFormat df = new java.text.DecimalFormat("#0.0000");
            String sl = df.format(xsd.getSl());
            xsd.setSl(Double.parseDouble(sl));
        }
        xsd.setZt("ybc");
        xsd.setLastUpdated(new Date());
        if (xsd.getXsmxList() != null) {
            for (Xsmx xsmx : xsd.getXsmxList()) {
                Kh kh = khDao.get(xsmx.getKh().getId());
                xsmx.setJtwz(kh.getJtwz());
                xsmx.setLastUpdated(new Date());
            }
        }
        this.nbxsdDao.save(xsd);
    }

    /**
     * 提交销售单
     *
     * @param xsd 销售单
     * @return
     */
    @Transactional
    public void commitXsd(Xsd xsd) {
        xsd.setZt("ytj");
        if (!xsd.getXslx().equals("kcls")) {
            xsd.setCwsh(true);
            xsd.setShr(YgService.getCurrentYg());
            xsd.setShsj(new Date());
        }
        calcKhSL(xsd, "minus");
        List<Xsmx> xsmxList = xsd.getXsmxList();
        for (Xsmx xsmx : xsmxList) {
            xsmx.setXscb(xsmx.getKh().getWsdj());
            xsmx.setLastUpdated(new Date());
        }
        xsd.setLastUpdated(new Date());
        this.nbxsdDao.save(xsd);
    }

    @Transactional
    public void calcKhSL(Xsd xsd, String type) throws RuntimeException {
        List<Xsmx> xsmxList = xsd.getXsmxList();
        Map<Long, Double> khSl = new HashMap<Long, Double>();
        if (xsmxList != null) {
            for (Xsmx xsmx : xsmxList) {
                Double value = khSl.get(xsmx.getKh().getId());
                if (value != null) {
                    khSl.put(xsmx.getKh().getId(), value + xsmx.getSbsl());
                } else {
                    khSl.put(xsmx.getKh().getId(), xsmx.getSbsl());
                }
            }
        }

        if (type.equals("add")) {
            for (Long id : khSl.keySet()) {
                this.khDao.updateKhKdslAdd(id, khSl.get(id));
            }
        } else {
            for (Long id : khSl.keySet()) {
                Kh kh = this.khDao.get(id);
                if (kh.getKkdsl() - khSl.get(id) < 0)
                    throw new RuntimeException("提交数量小于可开单数量，无法提交！");
            }
            for (Long id : khSl.keySet()) {
                this.khDao.updateKhKdsl(id, khSl.get(id));
            }
        }
    }

    /**
     * 调整销售单信息
     *
     * @param xsd 销售单
     * @return
     */
    @Transactional
    public void editXsdtz(Xsd xsd, Xsd hcxsd, Xsd yxsd) throws
            IllegalAccessException, NoSuchMethodException, InvocationTargetException, SQLException {
        xsd.setId(null);
        hcxsd.setId(null);

        List<Xsmx> xsmxList = yxsd.getXsmxList();
        List<Glfy> xsfyList = yxsd.getXsfyList();
        Psd psd = yxsd.getPsd();

        List<Xsmx> hcxsmxList = new ArrayList<Xsmx>();
        List<Glfy> hcglfyList = new ArrayList<Glfy>();
        Psd hcpsd = null;

        for (Xsmx xsmx : xsmxList) {
            Xsmx hcxsmx = new Xsmx();
            PropertyUtils.copyProperties(hcxsmx, xsmx);
            hcxsmx.setId(null);
            hcxsmx.setSbsl(0 - xsmx.getSbsl());
            hcxsmx.setHsj(0 - xsmx.getHsj());
            hcxsmx.setBhsj(0 - xsmx.getBhsj());
            hcxsmxList.add(hcxsmx);
        }
        for (Glfy xsfy : xsfyList) {
            Glfy hcxsfy = new Glfy();
            PropertyUtils.copyProperties(hcxsfy, xsfy);
            hcxsfy.setId(null);
            hcxsfy.setGlfymxList(null);
            hcxsfy.setJfsl(0 - xsfy.getJfsl());
            hcxsfy.setJe(0 - xsfy.getJe());
            hcglfyList.add(hcxsfy);
        }
        if (psd != null) {
            hcpsd = new Psd();
            PropertyUtils.copyProperties(hcpsd, psd);
            hcpsd.setId(null);
        }

        //保存原销售单
        yxsd.setSftzd(true);
        yxsd.setYxsd(yxsd);
        yxsd.setLastUpdated(new Date());

        //保存红冲的销售单
        hcxsd.setXsdh(xsdBm(hcxsd));
        hcxsd.setSftzd(true);
        hcxsd.setXsmxList(hcxsmxList);
        hcxsd.setXsfyList(hcglfyList);
        hcxsd.setPsd(hcpsd);
        hcxsd.setDateCreated(new Date());
        hcxsd.setCreateUser(YgService.getCurrentYg());
        hcxsd.setLastUpdated(hcxsd.getDateCreated());
        hcxsd.setYxsd(yxsd);

        this.nbxsdDao.save(yxsd);
        this.nbxsdDao.save(hcxsd);

        //保存新销售单
        xsd.setXsdh(xsdBm(xsd));
        xsd.setYxsd(yxsd);
        xsd.setZt(yxsd.getZt());
        xsd.setYck(yxsd.getYck());
        xsd.setYjs(yxsd.getYjs());
        for (Xsmx xsmx : xsd.getXsmxList()) {
            xsmx.setJtwz(xsmx.getKh().getJtwz());
        }
        xsd.setCreateUser(YgService.getCurrentYg());
        xsd.setDateCreated(new Date());
        xsd.setLastUpdated(xsd.getDateCreated());
        this.nbxsdDao.save(xsd);
    }

    @Transactional
    public void cancel(Xsd xsd) {
        xsd.setZt("ybc");
        calcKhSL(xsd, "add");
        this.nbxsdDao.save(xsd);
    }


    /**
     * 删除销售单信息
     *
     * @param id 销售单ID
     * @return
     */
    @Transactional
    public Xsd deleteXsd(Long id) {
        Xsd xsd = this.nbxsdDao.get(id);
        if (xsd.getXsjsd() != null) {
            throw new RuntimeException("禁止删除！改销售单已结算");
        }
        xsd.setCreateUser(YgService.getCurrentYg());
        xsd.setLastUpdated(new Date());
        xsd.setDeleted(1);
        this.nbxsdDao.save(xsd);
        this.nbxsdDao.deleteXsmx(id);
        return xsd;
    }

    /**
     * 查询没有付款的销售单
     *
     * @param nbgsId
     * @param qyjgId
     * @return
     */
    public List<Xsd> findAllXsdBySfyfk(Long nbgsId, Long qyjgId) {
        String hql = "from Xsd where (sfyfk is null or sfyfk = 0) and XSGS_ID =? and KH_ID=? order by dateCreated  asc";
        return this.nbxsdDao.find(hql, nbgsId, qyjgId);
    }

    @Transactional
    public String findKhByXsd(Long xsgsId) {
        Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd").create();
        List<Map> khList = this.nbxsdDao.findKhByXsd(xsgsId);
        String khJson = gson.toJson(khList);
        return khJson;
    }


    /**
     * 查询销售单已经付款的记录总和
     *
     * @param xsdId
     * @return
     */

    public Double getAllYfk(Long xsdId) {
        String sql = "select nvl(sum(fpje),0) from t_biz_zjfpmx where xsd_id=?";
        List list = this.zjfpmxDao.findBySQL(sql, xsdId);
        return Double.valueOf(list.get(0).toString());
    }

    /**
     * 更新是否已经完成付款，并保持付款记录
     *
     * @param xsdId
     * @param sfyfk
     * @param Fpje
     */
    @Transactional
    public void saveInfo(Long xsdId, String sfyfk, Double Fpje) {
        Xsd xsdTemp = this.nbxsdDao.get(xsdId);
        if (sfyfk.equals("1")) {
            xsdTemp.setSfyfk(sfyfk);
            xsdTemp.setYfksj(new Date());
        }
        this.nbxsdDao.save(xsdTemp);

        Zjfpmx zjfpmxTemp = new Zjfpmx();
        zjfpmxTemp.setNbgs(xsdTemp.getXsgs());
        if (xsdTemp.getKh() != null)
            zjfpmxTemp.setQyjg((Qyjg) xsdTemp.getKh());
        zjfpmxTemp.setXsd(xsdTemp);
        zjfpmxTemp.setFpje(Fpje);
        zjfpmxTemp.setDateCreated(new Date());
        this.zjfpmxDao.save(zjfpmxTemp);

    }

    @Autowired
    public void setNbgsDao(NbgsDao nbgsDao) {
        this.nbgsDao = nbgsDao;
    }

    @Autowired
    public void setKhDao(KhDao khDao) {
        this.khDao = khDao;
    }
    @Autowired
    public void setNbxsdDao(NbxsdDao nbxsdDao) {
        this.nbxsdDao = nbxsdDao;
    }
    @Autowired
    public void setNbcgdDao(NbcgdDao nbcgdDao) {
        this.nbcgdDao = nbcgdDao;
    }

    @Autowired
    public void setBmService(BmService bmService) {
        this.bmService = bmService;
    }

    @Autowired
    public void setSjzdzDao(SjzdzDao sjzdzDao) {
        this.sjzdzDao = sjzdzDao;
    }

    @Autowired
    public void setZjfpmxDao(ZjfpmxDao zjfpmxDao) {
        this.zjfpmxDao = zjfpmxDao;
    }

}
